package com.itbac.service.impl;

import com.itbac.dao.ProductDao;
import com.itbac.domain.Product;
import com.itbac.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * @author: BacHe
 * @email: 1218585258@qq.com
 * @Date: 2021/4/19 22:56
 */
@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductDao productDao;

    @Override
    public Product getById(Integer pid) {
        Optional<Product> productOptional = productDao.findById(pid);
        return productOptional.orElse(null);
    }
}
